
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>
        车位使用添加
    </title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/main.css" media="all">

    <style>
        .imgs{display: none;}
    </style>

</head>
<body>

<div class="x-body">
    <form class="layui-form layui-form-pane" action="${pageContext.request.contextPath}/asset/add" id="add">
        <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
            <div class="layui-tab-content" >
                <div class="layui-tab-item layui-show">
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>所属小区
                        </label>
                        <div class="layui-input-block">
                            <select name="cid" id="community_id">
                                <c:forEach items="${maps.communities}" varStatus="state" var="community">
                                    <option value="${community.id}">${community.name}</option>
                                </c:forEach>
                            </select>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>设备名称
                        </label>
                        <div class="layui-input-block">
                            <select name="did" >
                                <c:forEach items="${maps.devices}" varStatus="state" var="device">
                                    <option value="${device.id}">${device.name}</option>
                                </c:forEach>
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>购买数量
                        </label>
                        <div class="layui-input-block">
                            <input type="text" name="count" autocomplete="off" placeholder="空制在80个汉字，160个字符以内"
                                   class="layui-input" value="" required>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>预计使用年限(年)
                        </label>
                        <div class="layui-input-block">
                            <input type="text" name="limitYear" autocomplete="off" placeholder="空制在80个汉字，160个字符以内"
                                   class="layui-input" value="" required>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>购买日期
                        </label>

                        <div class="layui-input-inline">
                            <input class="layui-input" name="purchaseTime" placeholder="开始时间" id="LAY_demorange_s" value="" required>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>状态
                        </label>
                        <div class="layui-input-block">
                            <input type="radio" name="state" value="1" title="可用" required >
                            <div class="layui-unselect layui-form-radio layui-form-radioed">
                                <i class="layui-anim layui-icon layui-anim-scaleSpring"></i>
                                <div>有效</div>
                            </div>
                            <input type="radio" name="state" value="0" title="禁用" checked="checked" required>
                            <div class="layui-unselect layui-form-radio">
                                <i class="layui-anim layui-icon"></i>
                                <div>无效</div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <button class="layui-btn" type="submit" lay-filter="add" lay-submit="">
                            添加
                        </button>
                    </div>
                    <div style="height:100px;"></div>
                </div>
            </div>

        </div>
    </form>
</div>
<script src="${pageContext.request.contextPath}/lib/layui/layui.js" charset="utf-8"></script>
<script src="${pageContext.request.contextPath}/js/x-layui.js" charset="utf-8"></script>
<script>
    layui.use(['laydate','element','layer','form'], function(){


        form = layui.form();
        laydate = layui.laydate;//日期插件
        form.render();
        var start = {
            min: laydate.now()
            ,max: '2099-06-16 23:59:59'
            ,istoday: false
            ,choose: function(datas){
                //end.min = datas; //开始日选好后，重置结束日的最小日期
                //end.start = datas //将结束日的初始值设定为开始日
            }
        };
        document.getElementById('LAY_demorange_s').onclick = function(){
            start.elem = this;
            laydate(start);
        };

    })
</script>

</body>
</html>